<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <title>Document</title>
    <style>
        .box{
            width:300px;
            height:300px;
        }
        @media screen and (max-width:768px) {
            .box{
                background:rgb(0, 255, 0);
            }
        }
        @media screen and (min-width:768px) and (max-width:996px){
            .box{
                background:rgb(0, 0, 255);
            }
        }
        @media screen and (min-width:996px){
           .box{
                background:rgb(255, 0, 0);
            }
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>